# coding:utf-8
'''
    author='chenyong'
    time='2017/9/12'
'''
import pickle
'''
    把对象转化为2进900
'''

class GameState(object):
    def __init__(self, level=0, lives=4, points=0):
        self.level = level
        self.lives = lives
        self.points = points

one = GameState()
strOne = pickle.dumps(one)
print pickle.loads(strOne)

import struct

'''0
    根据一定格式fmt
    i = int
    b = byte 
    H = unsignedshort 2
'''
print struct.pack
print struct.unpack